class Round {

    //int roundID
    Move redMove
    Move blackMove

    static belongsTo = [game: Game]
    static constraints = {
        redMove(nullable: true)
        blackMove(nullable: true)
    }

    Round() {
        this.redMove = null
        this.blackMove = null
    }

    def move(newMove) {
        if (this.redMove == null) {
            this.redMove = newMove
        } else {
            this.blackMove = newMove
        }
    }

    String toString() {
        if (blackMove == null) {
            log.info "only Red"
            return "Red move ${redMove}, Black move none"
        } else {
            log.info "both move"
            return "Red move ${redMove}, Black move ${blackMove}"
        }
    }
}
